<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getL10nLanguageCode(); ?>" lang="<?php echo $this->getL10nLanguageCode(); ?>" dir="ltr">
<head>
    <?php
    $theme = Kohana::config('yosemin.theme');
    $jQueryVersion = '1.9.1';
    $jQueryUiVersion = '1.10.0';
    $jQueryDir = 'javascript/jquery/';
    $jQueryScriptSuffix = IN_PRODUCTION ? '.min' : '';
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" href="<?php echo url::base() . 'favicon.png' ?>" type="image/png" />

    <?php
    echo html::css($jQueryDir . $jQueryUiVersion . '/css/smoothness/jquery-ui-' . $jQueryUiVersion . '.custom.css', FALSE);
    echo html::css($jQueryDir . 'external/multiselect-63b58c6/css/ui.multiselect.css', FALSE);
    echo html::css($jQueryDir . 'external/jqGrid-3.6.5/css/ui.jqgrid.css', FALSE);
    echo html::css('yosemin.css');
    if ($space) {
        // echo html::css('yosemin-' . $space . '.css');
    }
    if (! $noTheme) {
        echo html::css($theme . '.css');
    }

    echo html::javascript($jQueryDir . $jQueryUiVersion . '/js/jquery-' . $jQueryVersion . $jQueryScriptSuffix . '.js');
    echo html::javascript($jQueryDir . $jQueryUiVersion . '/js/jquery-ui-' . $jQueryUiVersion . '.custom' . $jQueryScriptSuffix . '.js');
    
    echo html::javascript($jQueryDir . $jQueryUiVersion . '/development-bundle/ui/i18n/jquery.ui.datepicker-' . router::$language . '.js');
    /*
    echo html::javascript($jQueryDir . 'external/jqGrid-3.6.5/src/ui.multiselect.js');
    echo html::javascript($jQueryDir . 'external/jqGrid-3.6.5/js/i18n/grid.locale-en.js');
    echo html::javascript($jQueryDir . 'external/jqGrid-3.6.5/js/jquery.jqGrid.min.js');
    */
    echo html::javascript($jQueryDir . 'external/jquery.json-2.4.js');
    echo html::javascript($jQueryDir . 'external/jquery.ui.combobox.js');
    echo html::javascript('javascript/yosemin.js');
    ?>

    <script type="text/javascript">
        $.datepicker.setDefaults({
            showOn: 'button', /* both, focus, button */
            buttonImage: '<?php echo url::base() ?>themes/default/images/calendar.png',
        });
        
        var i18n = {
            deleteConfirmQuestion: '<?php echo text::getEscaped('button.delete-confirmQuestion') ?>',
        };

        Yosemin.Autocomplete.showAllItemsLabel = '<?php echo javascript::escape(text::get('application-autocomplete-showAllItems')) ?>';
        Yosemin.Autocomplete.valueDidNotMatchMessage = '<?php echo javascript::escape(text::get('application-autocomplete-valueDidNotMatch')) ?>';
        
        var config = {
            urlBase: '<?php echo url::base() ?>',
            indexFileUrl: '<?php echo url::base(TRUE) ?>',
            sessionPropertySetUrl: '<?php echo url::site('/user/userSettings/setSessionProperty') ?>'
        };

        var sql = {
            trueValue: '<?php echo sql::$TRUE ?>',
            falseValue:'<?php echo sql::$FALSE ?>'
        };
    </script>

    <title><?php echo htmlSpecialChars($title); ?></title>
    <?php echo $extraHead; ?>
</head>
